package com.maxie.factory.abstractfactory.entity;

import com.maxie.factory.abstractfactory.entity.ingredient.factory.PizzaIntegredFactory;
public class CNPizza extends Pizza {

    /**
     * 原料需要工厂来创建，不需要Pizza创建
     */
    private PizzaIntegredFactory factory;

    public CNPizza(PizzaIntegredFactory factory) {
        this.factory = factory;
    }
    @Override
    public void prepare() {
        this.mianfen = factory.createMianfen();
        this.huotui = factory.createHuotui();
        this.egg = factory.createEgg();
    }
}
